<!--#layout("/common/layout.html",{"jsBase":"/js/person/customerExtInfo/"}){ -->
<div class="layui-row">
    <form id="searchForm" class="layui-form layui-form-pane">
        <div class="layui-collapse" lay-filter="condictionCol">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">查询条件</h2>
                <div class="layui-colla-content layui-show">
                    <div class="layui-row">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <!--#if(accessType==6){ -->

                                <label class="layui-form-label">区域</label>
                                <div class="layui-input-inline">
                                    <layui:simpleDataSelect name="orgId" value="" data="${orgList}"
                                                            attrId="id" attrName="name" laySearch="true" layFilter="orgFilter"/>
                                </div>
                                <!--#}-->
                                <!--#if(accessType>1){ -->
                                <label class="layui-form-label">服务老师</label>
                                <div class="layui-input-inline">
                                    <!--<layui:simpleDataSelect name="customerId" value="" data="${customerInfoList}"
                                                            attrId="customerId" attrName="customerName" layFilter="customerFilter"
                                                            laySearch="true" lay-verify="required" />-->
                                    <select style="width:40%" class="select" name="customerId" id="customerId" selectValue="" promtion="请选择" lay-search>
                                        <option value="">请选择</option>
                                    </select>
                                </div>
                                <!--#}-->
                                <label class="layui-form-label">老师头衔</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="job" autocomplete="off" class="layui-input">
                                </div>

                                <button style="float: right;" class="layui-btn layui-btn-normal" type="button" id="searchFormSearch">搜索</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>

<div class="layui-btn-group">
    <layui:accessButton function="person.customerExtInfo.add" action="add">新增</layui:accessButton>
    <layui:accessButton function="person.customerExtInfo.edit" action="edit">编辑</layui:accessButton>
    <layui:accessButton function="person.customerExtInfo.del" action="del">删除</layui:accessButton>
    <layui:accessButton function="person.customerExtInfo.ext" action="chapter">特长列表</layui:accessButton>
</div>

<table id="customerExtInfoTable" lay-filter="customerExtInfoTable"></table>
<!--#} -->
<script>
    layui.use(['index','form'], function () {
        var index = layui.index,
            form = layui.form;
        index.init();

        form.on('select(orgFilter)', function(data){
            setAuthor(data.value);
        });

        setAuthor("${orgId}");

        function setAuthor(id) {
            $.ajax({
                type: 'POST',
                url: "${ctxPath}/person/customerExtInfo/getTeacher.json",
                data: {
                    orgId:id
                },
                dataType:'json',
                success: function(data){
                    $("#customerId").html("");
                    $("#customerId").append($("<option>").val("").text("请选择"));
                    $.each(data.data, function(key, val) {
                        var option1 = $("<option>").val(val.customerId).text(val.customerName);
                        $("#customerId").append(option1);

                    });
                    form.render('select');
                }
            });
        }
    });

</script>
